<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<!-- meta -->
<meta name="keywords" content="">
<meta name="description" content="">
<!-- /meta -->
<title>XMLファイルダウンロード一覧</title>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/base.css">
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/headerfooter.css">
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/ulol.css">
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/arrow.css">
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/elements.css">
<!-- admin -->
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/base_admin.css">
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/elements_admin.css">
<!-- /admin -->
<script src="<%= request.getContextPath() %>/common/js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/common/js/library.js"></script>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/for_winie3.css">
<!--[if gte IE 5]>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/for_over_winie5.css">
<![endif]-->
<!--[if IE 5]>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/for_winie5.css">
<![endif]-->
</head>
<script type="text/javascript">
$(function() {


	$('#encoding').change(function(){
	      if ('0' == $(this).val()) {
	    	  $('#encodingOther').attr("disabled", "");
	      } else {
	    	  $('#encodingOther').attr("disabled", "disabled");
	      }
	});

})

function downloadXml(keySchemaid, lv1Dataid, lv2Dataid, lv3Dataid) {

	if ($('#encoding').val() == '0') {
		if ($('#encodingOther').val() == null || $('#encodingOther').val() == '') {
			alert("エンコーディングを入力してください。");
			return;
		}
	}


	$('#keySchemaid').val(keySchemaid);
	$('#lv1Dataid').val(lv1Dataid);
	$('#lv2Dataid').val(lv2Dataid);
	$('#lv3Dataid').val(lv3Dataid);

	downloadForm.submit();
}


//属性を追加する
function addAttr() {

	downloadForm.action = '<%= request.getContextPath() %>/outputconv/rootAddAttr';
	downloadForm.submit();
}
//属性を削除する
function delAttr(index) {
	$('#deleteId').val(index);
	downloadForm.action = '<%= request.getContextPath() %>/outputconv/rootDelAttr'
	downloadForm.submit();
}

</script>
<body id="dch">
<!-- === headerArea === -->
<div id="headerArea">
<a name="pageTop" id="pageTop"></a>
<jsp:include page="/common/include/header.jsp" />
</div><!-- === /headerArea === -->
<!-- === mainArea === -->
<div id="mainArea">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
	<tr valign="top">
		<td width="140" id="leftArea">
			<jsp:include page="output_menu.jsp" />
			<!-- /listA01 -->
		<!-- === /leftArea === -->
		</td>
		<td width="20"><img src="<%= request.getContextPath() %>/common/images/spacer.gif" width="20" height="4" border="0" alt=""></td>
		<td id="contentsArea">
		<!-- === contentsArea === -->
			<!-- headingLv01Block -->
			<div class="headingLv01Block">
				<!-- headingLv01 -->
				<h1>XMLファイルダウンロード一覧</h1>
				<!-- /headingLv01 -->
				<!-- lead -->
				<div class="lead">
				</div>
				<!-- /lead -->
			</div>
			<!-- /headingLv01Block -->
			<!-- columnB01 -->
			<div class="columnB01">
				 <s:fielderror/>
			</div>
			<!-- /columnB01 -->
			<!-- headingLv02 -->
			<div class="headingLv02">
			<table border="0" cellspacing="0" cellpadding="5" width="558">
				<tr>
					<td><p><em>XMLファイルダウンロード一覧<br></em></p></td>
				</tr>
			</table>
			</div>
			<form action="<%= request.getContextPath() %>/outputconv/download" method="post" id="downloadForm" name="downloadForm">
			<s:hidden name = "keySchemaid" />
			<s:hidden name = "lv1Dataid" />
			<s:hidden name = "lv2Dataid" />
			<s:hidden name = "lv3Dataid" />

			<input type="hidden" id = "deleteId" name = "deleteIndex" />
			<!-- tableBlock -->
			<div class="tableBlock">
				<!-- tableA01 -->
				<div class="tableA01">
				<table border="1" cellspacing="0" cellpadding="5" width="558">

					<tr>
						<!-- ラベル --><th class="lv01B" width="170"><label for="version">バージョン</label></th>
						<!-- エラー --><th width="11" class="error">&nbsp;</th>
						<!-- 内容 --><td><s:select list="#{'1.0':'1.0'}" name="version"  /></td>
					</tr>
					<tr>
						<!-- ラベル --><th class="lv01B" width="170"><label for="name">エンコーディング</label></th>
						<!-- エラー --><th width="11" class="error">&nbsp;</th>
						<!-- 内容 --><td><s:select list="#{'UTF-8':'UTF-8','Shift-JIS':'Shift-JIS','EUC-JP':'EUC-JP','0':'その他'}" name="encoding"  /><s:textfield name="encodingOther" disabled="true"/>  </td>
					</tr>

					<tr>
						<!-- ラベル --><th class="lv01B" width="170" ><label for="root">ルート要素名</label></th>
						<!-- エラー --><th width="11" class="error">&nbsp;</th>
						<!-- 内容 --><td><s:textfield name = "rootTagName" cssErrorStyle="background-color: #FFE4E1"/></td>
					</tr>

				</table>
				</div>

				<div class="tableA01">
				<table border="1" cellspacing="0" cellpadding="5" width="558">
					<tr>
						<th class="lv01B" width="30%">
							Attribute名
						</th>
						<th class="lv01B" width="60%">
							内容
						</th>
						<th class="lv01B" width="10%">
							処理
						</th>
					</tr>
					<s:iterator value="rootAttrList" status="attrStat">
						<tr>
							<td width="30%">
								<s:textfield cssClass="attrinputcls" name="rootAttrList[%{#attrStat.index}].name" value="%{name}" size="10" maxlength="200" cssErrorStyle="background-color: #FFE4E1"/>
							</td>
							<td width="60%">
								<s:textfield cssClass="attrinputcls" name="rootAttrList[%{#attrStat.index}].value" value="%{value}" size="14"  maxlength="200" cssErrorStyle="background-color: #FFE4E1"/>
							</td>
							<td width="10%">
								<input type="button" value="削除" onclick="delAttr('<s:property value="%{#attrStat.index}"/>')" />
							</td>
						</tr>
					</s:iterator>
				</table>
				<input type="button" value="追加" onclick="addAttr()" />
				</div>

				<!-- /tableA01 -->
			</div>
			<!-- /headingLv02 -->

			<!-- tableBlock -->
			<div class="tableBlock">
				<!-- tableBtn -->
				<!-- /tableBtn -->
				<!-- tableA01 -->
				<div class="tableA01">
				<table border="1" cellspacing="0" cellpadding="5">
					<tr>
						<th class="lv01B">出力</th>
						<th class="lv01B">作成機関の概要名称</th>
						<th class="lv01B">目録データ概要名称</th>
						<th class="lv01B">資料群全体名称</th>
					</tr>
					<s:iterator value="dataGroupList">
					<tr>
						<td>
							<input type="button" value="出力" onclick="downloadXml('<s:property value="keySchemaid"/>','<s:property value="lv1Dataid"/>','<s:property value="lv2Dataid"/>','<s:property value="lv3Dataid"/>')" />
						</td>
						<td><s:property value="lv1DataName"/></td>
						<td><s:property value="lv2DataName"/></td>
						<td><s:property value="lv3DataName"/></td>
					</tr>
					</s:iterator>
				</table>
				</div>
				<!-- /tableA01 -->
				<!-- /tableBtn -->
			</div>
			<!-- /tableBlock -->
			<!-- pageNaviC01 -->
			<div class="pageNaviC01">
			</div>
			<!-- /pageNaviC01 -->
			</form>
		<!-- === /contentsArea === -->
		</td>
		<td width="16"><img src="<%= request.getContextPath() %>/common/images/spacer.gif" width="16" height="4" border="0" alt=""></td>
	</tr>
</table>
</div><!-- === /mainArea === -->
<!-- === footerArea === -->
<div id="footerArea">
<jsp:include page="/common/include/footer.jsp" />
</div><!-- === /footerArea === -->
</body>
</html>
<!-- System Architect is COOBA Corp
	Copyright 2010 COOBA Corp All rights reserved -->